Inference of polymorphic and conditional strictness propertiesThomas
نویسنده
چکیده
We deene an inference system for modular strictness analysis of functional programs by extending a conjunctive strictness logic with polymorphic and conditional properties. This extended set of properties is used to deene a syntax-directed, polymorphic strictness analysis based on polymorphic recur-sion whose soundness is established via a translation from the polymorphic system into the conjunctive system. From the polymorphic analysis, an inference algorithm based on constraint resolution is derived and shown complete for variant of the polymorphic analysis. The algorithm deduces at the same time a property and a set of hypotheses on the free variables of an expression which makes it suitable for analysis of program with module structure. 1 Introduction Static analysis of program fragments with free variables usually either requires an environment associating a property with each free variable or assumes that only trivial properties hold of the free variables. For programs structured into modules the latter approach is often the only one feasible and leads to poor analysis results. This paper suggests an improvement to this by proposing a modular program analysis framework where analysis of a program fragment results in a property and and environment that together describes the relation between the properties of the free variables and the result of the program. The presentation of program analyses via a set of logical inference rules (also called \non-standard type systems") is now a commonly used tool and has been applied to strictness , binding-time and control-ow analysis amongst others. Our approach consists in extending existing monomorphic analyses with polymorphic and conditional program properties (deened below). We focus on strictness analysis in this paper but a similar analysis for binding-time could be obtained from the analysis described in 10] and recently Banerjee 3] has presented a control-ow analysis for the pure lambda calculus, engineered using similar methods. Strictness types were considered by Kuo and Mishra 21]. With f standing for the property \undeened", a function is
منابع مشابه
Strictness Logic and Polymorphic Invariance
We describe a logic for reasoning about higher-order strictness properties of typed lambda terms. The logic arises from axiomatising the inclusion order on certain closed subsets of domains. The axiomatisation of the lattice of strictness properties is shown to be sound and complete, and we then give a program logic for assigning properties to terms. This places work on strictness analysis via ...
متن کاملProjections for Polymorphic First-Order Strictness Analysis
We apply the categorical properties of polymorphic functions to compile-time analysis, speciically projection-based strictness analysis. First we interpret parameterised types as functors in a suitable category, and show that they preserve monics and epics. Then we deene \strong" and \weak" polymorphism, the latter admitting certain projections that are not polymorphic in the usual sense. We pr...
متن کاملStrictness Analysis in Logical Form
y Abstract This paper presents a framework for comparing two strictness analysis techniques: Abstract interpretation and non{standard type inference. The comparison is based on the representation of a lattice by its ideals. A formal system for deducing inclusions between ideals of a lattice is presented and proved sound and complete. Viewing the ideals as strictness properties we use the formal...
متن کاملType Inference, Abstract Interpretation and Strictness Analysis
Coppo, M. and A. Ferrari, Type inference, abstract interpretation and strictness analysis, Theoretical Computer Science 121 (1993) 113-143. Filter domains (Coppo et al., 1984) can be seen as abstract domains for the interpretation of (functional) type-free programming languages. What is remarkable is the fact that in filter domains the interpretation of a term is given by the set of its types i...
متن کاملStrictness Types: An Inference Algorithm and an Application
This report deals with strictness types, a way of recording whether a function needs its argument(s) or not. We shall present an inference system for assigning strictness types to expressions and subsequently we transform this system into an algorithm capable of annotating expressions with strictness types. We give an example of a transformation which can be optimized by means of these annotati...
متن کامل